Optimal Inference of Fields in Row- Polymorphic Records (Proof Appendix)

نویسنده

  • Axel Simon
چکیده

This report contains the derivation details of the paper of the same name [7]. A. Additional Preliminaries This section contains proves and more on the derivation process. It is an extension of [6]. Without loss of generality we assume that all letand λ-bound variables x ∈ X are pair-wise different. Let X ⊆ X denote the set of variables that are λ-bound. Let x ≺X y iff x is in scope of y. We write environments as [x1 7→ t1, . . . xn 7→ tn] where xi ≺X xi+1. Define args ⊆ P(X) such that m ∈ args contains a function f ∈ X \ X and m \ {f} are the λ-bound arguments of f . For instance, args = {{f, s}, {s′}, {v}} for the introductory example. We give a formal definition of how to compute args from a program e ∈ E. Let ξ ∈ X \ X be a function symbol that represents the owner of outermost λ-variables. Each function symbol and its owned λ-bound variables form a so-called monomorphic group, a notion we use to specify what variables to instantiate when accessing letand λ-bound variables. DEFINITION 1. A variable set V ⊆ X forms a monomorphic group in program P iff V ∈ args(P ) where args(P ) := {V ⊆ X | ∃f . {f} = (V \ X) ∧ ∀x ∈ (V ∩ X) . 〈f, x〉 ∈ own(ξ, P )}. As informally described above, we let args denote the set of all monomorphic groups of the current program. Observe that args is a partitioning of λ-bound variables: PROPOSITION 1. Let {V1, . . . Vn} = args(P ) and X the be the set of variables in P . Then Vi ∩ Vj = ∅ for all i 6= j and X ⊆ ⋃n i=1 Vi. Proof. Let ex denote the expression ex ≡ λx . e′ that binds x. Show i 6= j implies Vi ∩ Vj = ∅. By construction, exactly one function symbol f ∈ X \ X exists in Vi. Let x ∈ Vi ∩ Vj ∩ X and thus 〈f, x〉 ∈ own(ξ, P ). Then there exists a function symbol g ∈ Vj with 〈g, x〉 ∈ own(ξ, P ). Since all variable bindings feature different variables, the same expression ex must have been visited by own, once with own(f, ex) and once with own(g, ex) which is a contradiction since own visits every sub-expression of P exactly once. Now show X ⊆ ⋃n i=1 Vi. By definition of own, for each x ∈ X, ex is visited exactly once, returning 〈f, x〉. Thus there exists Vi with f, x ∈ Vi as required. Intuitively, each monomorphic group Vi contains one let-bound function f and its arguments Vi\{f}. Since args(P ) partitions X, each λ-bound variable is argument to only one function. B. Concrete Semantics In this section we present the concrete semantic of the language in Fig. 1 in [7] by closely following a definition by Milner [5] but adding the operations on records. Let S⊥ := S ∪ {⊥S} where ⊥S / ∈ S denotes an undefined value or a non-terminating evaluation. The denotational standard semantics evaluates e ∈ E to a program value U⊥ where U is a sum of constructors terms A, records R, functions F and the wrong value ω, that denotes a type error. A record r ∈ R is a partial map from names to values. They are constructed from the empty map [] and extended using r[N 7→ v]. Define values U as follows:

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Executable Specification of Typing Rules for Extensible Records based on Row Polymorphism

Type inference is an application domain that is a natural fit for logic programming (LP). LP systems natively support unification, which serves as a basic building block of typical type inference algorithms. In particular, polymorphic type inference in the Hindley–Milner type system (HM) can be succinctly specified and executed in Prolog. In our previous work, we have demonstrated that more adv...

متن کامل

First-class labels for extensible rows

This paper describes a type system for extensible records and variants with first-class labels; labels are polymorphic and can be passed as arguments. This increases the expressiveness of conventional record calculi significantly, and we show how we can encode intersection types, closed-world overloading, type case, label selective calculi, and first-class messages. We formally motivate the nee...

متن کامل

A Polymorphic Type System for Extensible Records and Variants

Records and variants provide flexible ways to construct datatypes, but the restrictions imposed by practical type systems can prevent them from being used in flexible ways. These limitations are often the result of concerns about efficiency or type inference, or of the difficulty in providing accurate types for key operations. This paper describes a new type system that remedies these problems:...

متن کامل

Supplement to “Optimal inference in a class of regression models”

This supplement provides appendices not included in the main text. Supplemental Appendix C compares our approach with other methods, and includes a Monte Carlo study. Supplemental Appendix D contains details for the results in Section 3 not included in the main text. Supplemental Appendix E contains details for the RD application. Supplemental Appendix F considers feasible versions of the proce...

متن کامل

Supplemental Materials for “Optimal inference in a class of regression models”

These supplemental materials provide appendices not included in the main text. Supplemental Appendix D gives derivations for the examples given in Sections 4 and 5. Supplemental Appendix E considers feasible versions of the procedures in Section 3 in the case with unknown error distribution and derives their asymptotic efficiency. Supplemental Appendix F gives some auxiliary results used for re...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014